#ifndef __VOBJCATALOGCTRL_H
#define __VOBJCATALOGCTRL_H
	

#include "MObjCatalog.h"
#include "TPresenter.h"
#include "TViewCtrlPanel.h"
#include "VObjCatalogTable.h"

namespace wh{
namespace view{



class VObjCatalogCtrl
	: public wxPanel
	, public ctrlWithResMgr
	
{
	// hold parent node 
	std::shared_ptr<wh::object_catalog::MObjCatalog> mCatalogModel;

	wxAuiToolBar*		mToolBar = nullptr;
	wxMenu				mContextMenu;
	VObjCatalogTable*	mTableView = nullptr;

public:

	VObjCatalogCtrl(wxWindow* parent,
		wxWindowID id = wxID_ANY,
		const wxPoint& pos = wxDefaultPosition,
		const wxSize& size = wxDefaultSize,
		long style = wxTAB_TRAVERSAL,
		const wxString& name = wxPanelNameStr);
	~VObjCatalogCtrl();

	void OnActivated(wxDataViewEvent &evt);
	void OnBack(wxCommandEvent& event);

	void SetModel(std::shared_ptr<IModel> model);
	void GetSelected(std::vector<unsigned int>& selected);
	
	void BuildLoadItem();
	void BuildGoUpItem();
	void BuildSelectCatalog();

	void BuildDoMoveObject();
	void BuildDoActObject();


	void BuildCtrlItem(const int winid, const wxString& label,
		const std::function<void()>& itemFunc, const wxBitmap&	ico16, const wxBitmap&	ico24);

	bool GetSelectedObjKey(rec::PathItem& objKey)const;

	void DoMove();
	void DoAct();
};








}//namespace view
}//namespace wh
#endif //__*_H